package com.bawei.hgshop.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import com.bawei.hgshop.entity.Category;
import com.fasterxml.jackson.annotation.JsonProperty;

public interface CategoryMapper {

	
	List<Category> listByPid(int pid);

	@Delete("delete from hg_category where id=#{value}")
	int delete(int id);

	/*
	 * private int id; // 父节点的id private int parentId;
	 * 
	 * @JsonProperty(value = "text") private String name; private String path;
	 */
	@Update("update hg_category set name=#{name},path=#{path} where id=#{id}")
	int update(Category category);

	@Insert("insert into hg_category(name,parent_id,path) values(#{name},#{parentId},#{path})")
	int add(Category category);

}
